home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE4 / POWERBASE / DOCS / Ch13-Subst < prev    next >
Text File  |  2001-01-29  |  3KB  |  67 lines

  1. ========================
  2. Ch 13 − Subset databases
  3. ========================
  4.  
  5. Subset databases are fully-working Powerbase databases with exactly the same
  6. structure as the main database but containing only a selection of its
  7. records.
  8.  
  9. 13.1    Creating a subset
  10. -------------------------
  11. Creating a subset is extremely simple. Choose Export subset from the main
  12. menu and you will see a window strongly resembling the one used to export
  13. CSV files.  It features our old friend the Query panel into which you type a
  14. search formula which determines the records to be exported as a subset.
  15.  
  16. It is then only necessary to enter a suitable filename and drag the
  17. database icon to a filer window. The default pathname creates the new
  18. database as !Subset in PrintJobs. That’s probably not where you want it, but
  19. it is at least a familiar location from which you can extract the subset
  20. database later. You can accept this default by just clicking on Export or
  21. typing Return. Records are exported from the currently-selected subfile and
  22. will be placed in the corresponding subfile of the subset database.
  23.  
  24. On opening the new database you will find that it functions exactly
  25. like the original but contains only the selected records. It is made just
  26. large enough to contain the selected records so you will need to increase
  27. its length (see 10.5) if you intend to add any further records.
  28.  
  29. 13.2    Using a subset to shorten a database
  30. --------------------------------------------
  31. A database which has undergone a lot of deletions might have blank records
  32. scattered at random throughout its Database file and unused keys scattered
  33. at random throughout its indices.  If a database has 100 available records
  34. of which only 50 are in use you might want to get rid of the surplus records
  35. but aren’t able to do so by the simple shortening procedure described in Ch
  36. 10.5 because that only allows you to lop off the end of the database.  The
  37. amount by which the database can be shortened is often much less than the
  38. number of in-use records would suggest: in extreme cases you might not be
  39. able to shorten it at all by this method.  (Don’t be afraid to try, however. 
  40. Powerbase won’t let you butcher your database; it just  tells you you can’t
  41. do it.)
  42.  
  43. The solution to the problem is to export all the records as a
  44. subset.  Simply follow the instructions in 13.1 but don’t type anything into
  45. the query panel.  The resulting subset will contain the 50 in-use records
  46. and no extras at all.
  47.  
  48. There is a snag, unfortunately.  The Export subset feature operates
  49. only on the current subfile.  If your database uses more than one subfile
  50. things are a little more difficult.  You could accumulate all the records in
  51. subfile 0 (see 2.5.6), export the subset then move the records into the
  52. required subfiles.  Or you could export each subfile as a separate subset
  53. (the records in the subsets will be in the same subfiles as in the original
  54. database) and then merge the resulting subsets into one new database (see
  55. 10.4).
  56.  
  57.                                 - 57 -
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.